package com.cn.kehong.controller;

import com.cn.kehong.api.IProductPeiJizhongCollectService;
import com.cn.kehong.domain.ProductPeiJizhongCollect;
import com.cn.kehong.utils.JsonResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/jzCollect")
public class ProductPeiJizhongCollectController {

    @Autowired
    private IProductPeiJizhongCollectService productPeiJizhongCollectService;

    @RequestMapping("/getJiZhongData/{frontToken}")
    @ResponseBody
    public JsonResponse<ProductPeiJizhongCollect> getJiZhongData(@Param(value = "factoryName") String factoryName, @Param(value = "guanNum") String guanNum, @PathVariable(value = "frontToken",required = true) String frontToken) throws Exception {
        JsonResponse<ProductPeiJizhongCollect > response = new JsonResponse<ProductPeiJizhongCollect >();
        ProductPeiJizhongCollect data = productPeiJizhongCollectService.getJiZhongData(factoryName,guanNum);
        response.setResult(data);
        response.setSuccess(true);
        return  response;
    }
}
